package com.fullhome8.cn.wanghongweb.controller.restful;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {
    @Autowired
    KafkaTemplate kafkaTemplate;

    private static int index = 0;

    @RequestMapping("/testKafka")
    public void testkafka(String message) {
        kafkaTemplate.send("kjTest", "haha" + index++);
        kafkaTemplate.send("replicated-kafkatopic", "多条消息测试哈哈" + index ++);
    }
}